package com.hotel.management.exception;

/**
 * 员工信息重复异常类
 * 当员工的唯一字段（如手机号、邮箱）重复时抛出此异常
 * 
 * @author Hotel Management Team
 * @version 1.0.0
 * @since 2024-06-28
 */
public class DuplicateEmployeeException extends BusinessException {

    private static final long serialVersionUID = 1L;

    /**
     * 默认构造函数
     */
    public DuplicateEmployeeException() {
        super("DUPLICATE_EMPLOYEE", "员工信息重复");
    }

    /**
     * 带消息的构造函数
     */
    public DuplicateEmployeeException(String message) {
        super("DUPLICATE_EMPLOYEE", message);
    }

    /**
     * 带字段名和值的构造函数
     */
    public DuplicateEmployeeException(String fieldName, String fieldValue) {
        super("DUPLICATE_EMPLOYEE", fieldName + " '" + fieldValue + "' 已存在，请使用其他值");
    }

    /**
     * 带消息和原因的构造函数
     */
    public DuplicateEmployeeException(String message, Throwable cause) {
        super("DUPLICATE_EMPLOYEE", message, cause);
    }
}
